package com.catchpig.fund.domain.network.api

import com.catchpig.annotation.ServiceApi
import com.catchpig.fund.domain.entity.ExcellentFund
import com.catchpig.fund.domain.entity.PageData
import com.catchpig.fund.domain.network.converter.ResponseBodyConverter
import com.localebro.okhttpprofiler.OkHttpProfilerInterceptor
import retrofit2.http.Field
import retrofit2.http.GET

@ServiceApi(
    baseUrl = "https://danjuanfunds.com/djapi/",
    responseConverter = ResponseBodyConverter::class,
    debugInterceptors = [OkHttpProfilerInterceptor::class]
)
interface FundService {
    /**
     * 获取优秀的基金列表
     * @param type String
     * @param orderBy Int
     * @param pageSize Int
     * @param currentPage Int
     * @return PageData<MutableList<ExcellentFund>>
     */
    @GET("v3/filter/fund?type={type}&order_by={orderBy}&size={pageSize}&page={currentPage}")
    suspend fun getExcellentFunds(
        @Field("type") type: Int,
        @Field("orderBy") orderBy: String,
        @Field("pageSize") pageSize: Int,
        @Field("currentPage") currentPage: Int
    ): PageData<MutableList<ExcellentFund>>
}